package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.common.controller.LogicController;
import edu.ynu.se.xiecheng.achitectureclass.dao.UserDao;
import edu.ynu.se.xiecheng.achitectureclass.entity.User;
import edu.ynu.se.xiecheng.achitectureclass.service.UserService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

@Api(tags = "用户管理接口")
@RestController
@RequestMapping("/api/user")
public class UserController extends LogicController<UserService, UserDao, User, Long> {
    public UserController(UserService service) {
        super(service);
    }

    @GetMapping("/findByUsername")
    public User findByUsername(@RequestParam String username) {
        return service.findByUsername(username);
    }
}
